<?php

class formLogin{
	public function formLogin(){
	?>
		<form method="post" name="login" id="login" action="">
			<table border="1" align="center">
				<tr>
					<td colspan="2" align="center">Login</td>
				</tr>
				<tr>
					<td>Username : </td>
					<td><input type="text" name="username" id="username"></td>
				</tr>
				<tr>
					<td>Password : </td>
					<td><input type="password" name="pwd" id="pwd"></td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<input type="submit" name="Submit" value="Submit" id="submit" onclick="return checknull();">
						<input type="reset" name="reset" value="Reset" id="reset">
					</td>
				</tr>
			</table>
		</form>	
		
		<script language="JavaScript">	

			function checknull(){
				alert("Yes");
			}		
		</script>
		
	<?
	}
	
	public function jsForm(){
	?>
		<script type="text/javascript" language="JavaScript">	
			var txt_username = "Username";
			var txt_pwd = "Password";

			function checknull(){
				if(document.login.username.value = ""){
					alert("OK");
					return true;
				}
				else{
					return false;
				}
				alert("Yes");
			}
			
		</script>
	<?
	}
}

?>